Hop til hovedindhold
Document status35 - Reviewed

Networking

This document describes the network architecture and configuration for EnergyConnect. The infrastructure follows a hub-and-spoke network topology with centralized connectivity services.

Overview

EnergyConnect uses a multi-subscription architecture where each environment is deployed in its own Azure subscription with a dedicated Virtual Network (VNet). All VNets are peered with a central connectivity VNet that hosts shared resources like Azure Bastion, Azure Front Door and a Container Registry.

The Bastion host allows secure SSH/RDP access to virtual machines (VMs) in each environment without exposing them to the public internet. Connecting to the Bastion host makes it possible to connect to VMs in any peered VNet / environment.

Similar does the Container Registry provide a shared location for container images used by Azure Container Apps across all environments, since various Docker Images are common across environments.

This also reduces costs by having a single Bastion host for multiple environments instead of deploying separate Bastion hosts in each environment.

Key Components

ComponentPurpose
Virtual Network (VNet)Isolated network for each environment
NAT GatewayProvides outbound internet connectivity with static public IP
Network Security Groups (NSGs)Controls inbound/outbound traffic at subnet level
VNet PeeringConnects VNets to shared connectivity VNet
Azure BastionSecure remote access to VMs without public IPs
Azure Front DoorGlobal load balancing and WAF for web applications

Virtual Network Configuration

Each environment has a dedicated VNet divided into three subnets, each serving a specific purpose.

Subnet Architecture

SubnetPurposeDelegationNAT GatewayDefault Outbound
Container SubnetAzure Container AppsMicrosoft.App/environmentsYesDisabled (Private)
Database SubnetPostgreSQL VMsNoneYesDisabled (Private)
Agent Pool SubnetSelf-hosted DevOps agentsNoneYesDisabled (Private)

All subnets are private subnets with no default outbound access. Outbound connectivity is provided exclusively through the NAT Gateway to ensure a consistent, known egress IP address.


NAT Gateway

Each VNet includes a NAT Gateway to provide outbound internet connectivity for all private subnets. This ensures:

  • Consistent egress IP: All outbound traffic uses the same public IP, required for whitelisting with external services (e.g., DataHub 2.0)
  • No public IPs on resources: VMs and Container Apps remain private
  • Zone redundancy: The public IP is deployed across all availability zones (1, 2, 3)

When Energinet will deprecate the DataHub 2.0 connection the NAT Gateway will no longer be required, as there will be no need for whitelisting a Public Egress IP

Resource Locks

In production environments, the NAT Gateway and its public IP have CanNotDelete locks to prevent accidental deletion.

Network Security Groups (NSGs)

NSGs control traffic flow at the subnet level. Each subnet type has its own NSG with specific rules.

Container Subnet NSG

The Container NSG has no custom security rules defined - it relies on Azure Container Apps' built-in network isolation.

Database Subnet NSG

Rule NameDirectionPortSourceDestinationAction
Allow-Inbound-22-from-BastionInbound22 (SSH)Bastion Subnet CIDRVirtualNetworkAllow

This rule allows SSH access from the Azure Bastion subnet to database VMs for administrative access.

Agent Pool Subnet NSG

Rule NameDirectionPriorityPortSourceDestinationAction
allow-https-outboundOutbound100443**Allow
allow-http-outboundOutbound10180**Allow
Allow-Inbound-22-from-BastionInbound20022Bastion Subnet CIDRVirtualNetworkAllow

The agent pool requires outbound HTTP/HTTPS for communicating with Azure DevOps and pulling container images.

VNet Peering

VNets are peered with a central connectivity VNet to enable access to shared resources (Bastion, Front Door).

Peering Configuration

Two peering connections are established:

  1. Local to Remote (Customer VNet → Connectivity VNet)

    • Deployed in customer's networking resource group
  2. Remote to Local (Connectivity VNet → Customer VNet)

    • Deployed in the connectivity subscription
    • Uses naming: peer-to-{customer}-{environment}

Peering Properties

PropertyValueDescription
allowVirtualNetworkAccesstrueAllow VNet-to-VNet traffic
allowForwardedTrafficfalseDon't forward third-party traffic
allowGatewayTransitfalseNo VPN gateway transit
useRemoteGatewaysfalseDon't use remote VPN gateway

Azure Front Door

Azure Front Door is deployed as a global load balancer and CDN for the client web application and documentation apps.

Shared Front Door Profile

A single Front Door profile (ec-global-connectivity-afd) is shared across all customer environments, deployed in the global connectivity subscription.

Components per Environment

Each environment gets:

ComponentNaming PatternDescription
Endpointec-{environment}-fdePublic entry point for the environment
Origin Group{customer}-{environment}-origin-groupGroups Container App backends
Origin{service}-originPoints to Container App FQDN (e.g., client-origin, docs-origin)
Custom Domaincustomer-specificValidated via DNS TXT/CNAME records
RouteLinks endpoint to origin groupWith custom domain association

Traffic Flow

User → Front Door (Custom Domain) → Origin Group → Container App (private FQDN)

WAF Policy (shared)

Custom Domain Configuration

Custom domains require DNS records in the domain's DNS zone:

  1. TXT Record: For domain validation
  2. CNAME Record: Points to the Front Door endpoint hostname

Container App Environment

Azure Container Apps are deployed in a managed environment with VNet integration.

Network Configuration

PropertyValue
Public Network AccessEnabled
Infrastructure SubnetContainer Subnet (delegated to Microsoft.App/environments)
Zone Redundantfalse

Ingress Configuration

AppIngressExternalPort
Client (Angular)Enabledtrue (via Front Door)80
ECC APIEnabledfalse (internal only)8080
DMC APIEnabledfalse (internal only)8080
NTS APIEnabledfalse (internal only)8080
DocsEnabledtrue (via Front Door)80

Outbound Connectivity

Container Apps use the NAT Gateway for outbound traffic. The NAT Gateway's public IP must be whitelisted for:

  • DataHub 2.0 integration
  • External storage account access
  • Other third-party services

Network Watcher

Azure Network Watcher is deployed in each environment's networking resource group for:

  • Network diagnostics
  • Connection troubleshooting
  • Packet capture
  • NSG flow logs (if configured)

The Network Watcher is a required component for monitoring and diagnosing network issues within the VNets.

If a Network Watcher is not already enabled in the region per subscription, Azure will automatically deploy it